feat: Litigation AI assistant and command center enhancements - #47
Conversation
- Add Litigation AI page with 3-step evidence pipeline (Synthesize → Draft → QC)
using Cloudflare AI Gateway, replacing standalone Gemini-based HTML dashboard
- Add backend routes: POST /api/litigation/{synthesize,draft,qc}
- Add command center components (ActionStream, SystemPulse, VitalSigns)
- Add scrape jobs schema migration, fan-out dispatcher, job routes
- Add chittyId columns to obligations, properties, legal_deadlines, documents
- Expand cron with job scheduling capabilities
- Add MCP tool registration endpoints
- Redesign dashboard with command center layout
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (19)
📝 WalkthroughWalkthroughThis PR introduces a job queue orchestration system for scrape tasks with status lifecycle and retry tracking, refactors cron jobs to dispatch work asynchronously, adds a litigation assistant API with synthesis and QC, and redesigns the dashboard into a command-center interface with vital signs, action stream, and system pulse monitoring. Changes
Sequence Diagram(s)sequenceDiagram
participant Cron
participant JobDispatcher
participant JobQueue as Database
participant Scraper as Scraper/Router
participant FanOut
participant Services as Downstream Services
Cron->>JobDispatcher: enqueueJob(jobType, target)
JobDispatcher->>JobQueue: INSERT into cc_scrape_jobs
JobQueue-->>JobDispatcher: jobId
Cron->>JobDispatcher: processQueue()
JobDispatcher->>JobQueue: SELECT queued/retrying jobs
JobQueue-->>JobDispatcher: job rows
loop For each job
JobDispatcher->>JobQueue: UPDATE status='running', started_at=NOW()
JobDispatcher->>Scraper: executeScrape(jobType, target)
Scraper-->>JobDispatcher: { recordsSynced, result }
JobDispatcher->>JobQueue: UPDATE status='completed', result, completed_at
JobDispatcher->>FanOut: fanOutScrapeResult(context)
par Concurrent downstream
FanOut->>Services: POST to Intelligence
FanOut->>Services: POST to Calendar
FanOut->>Services: POST to Triage
FanOut->>Services: POST to Ledger
end
end
JobDispatcher-->>Cron: { processed, succeeded, failed }
sequenceDiagram
participant User
participant UI as Litigation UI
participant API as Backend
participant AIGateway as AI Gateway
User->>UI: Enter raw notes
User->>UI: Click Synthesize
UI->>API: POST /litigation/synthesize
API->>AIGateway: POST /compat/chat/completions
AIGateway-->>API: synthesis (markdown)
API-->>UI: { synthesis }
UI->>UI: Render synthesis with tags
User->>UI: Set recipient/focus, click Draft
UI->>API: POST /litigation/draft
API->>AIGateway: POST with synthesized facts
AIGateway-->>API: draft email (plain text)
API-->>UI: { draft }
UI->>UI: Render draft with copy button
User->>UI: Click QC
UI->>API: POST /litigation/qc
API->>AIGateway: POST comparison request
AIGateway-->>API: JSON array of flags
API-->>UI: { flags, warning? }
UI->>UI: Render QC report per flag
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
To use Codex here, create a Codex account and connect to github. |
Summary
/litigation) — AI-powered legal assistant with case context, document analysis, and deadline tracking via new/api/litigation/*routesjob-dispatcher.ts,fan-out.ts) with scrape job tracking, cron Phase 11 integration, and/api/jobs/*management routescc_scrape_jobstable for tracking scrape job lifecyclelitigation_query_deadlines,litigation_analyze_document,litigation_get_case_context,litigation_draft_responseTest plan
npm run devstarts without errors/litigationpage renders and AI assistant chat works/api/jobsCRUD endpointsnpm run ui:buildto confirm frontend compiles/mcpendpoint🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
UI/UX
Chores